<script setup lang="ts">
import { ref } from 'vue'
import useArticel from '../../composition/useArticel'
import ArticelList from '../../components/articel-list.vue'

const active = ref(0)
const { getCategoryList, categoryList } = useArticel()

await getCategoryList()
</script>

<template>
   <div class="w-screen h-screen bg-[#f3f3f3]">
      <van-nav-bar title="代码写的烂，牛马程序员" />
      <van-tabs sticky v-model:active="active">
         <van-tab v-for="item in categoryList?.data" :title="item.name">
            <div class="pb-10">
               <ArticelList :id="item.id" />
            </div>
         </van-tab>
      </van-tabs>
   </div>
</template>
